/*
 * Copyright (c) 2015. 石头哥哥
 */

package com.comom.manager.model;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serializable;

@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class User implements Serializable {
    private Integer uid;

    private String nickname;

    private String password;

    private String mobile;

    private String icon;

    private String otheruid;

    private String token;

    private Integer did = 0;

    private Integer opentype;

    private String sefdoctortime;

    private static final long serialVersionUID = 1L;

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname == null ? null : nickname.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile == null ? null : mobile.trim();
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon == null ? null : icon.trim();
    }

    public String getOtheruid() {
        return otheruid;
    }

    public void setOtheruid(String otheruid) {
        this.otheruid = otheruid == null ? null : otheruid.trim();
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token == null ? null : token.trim();
    }

    public Integer getDid() {
        return did;
    }

    public void setDid(Integer did) {
        this.did = did;
    }

    public Integer getOpentype() {
        return opentype;
    }

    public void setOpentype(Integer opentype) {
        this.opentype = opentype;
    }

    public String getSefdoctortime() {
        return sefdoctortime;
    }

    public void setSefdoctortime(String sefdoctortime) {
        this.sefdoctortime = sefdoctortime == null ? null : sefdoctortime.trim();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        User other = (User) that;
        return (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()))
                && (this.getNickname() == null ? other.getNickname() == null : this.getNickname().equals(other.getNickname()))
                && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
                && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))
                && (this.getIcon() == null ? other.getIcon() == null : this.getIcon().equals(other.getIcon()))
                && (this.getOtheruid() == null ? other.getOtheruid() == null : this.getOtheruid().equals(other.getOtheruid()))
                && (this.getToken() == null ? other.getToken() == null : this.getToken().equals(other.getToken()))
                && (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid()))
                && (this.getOpentype() == null ? other.getOpentype() == null : this.getOpentype().equals(other.getOpentype()))
                && (this.getSefdoctortime() == null ? other.getSefdoctortime() == null : this.getSefdoctortime().equals(other.getSefdoctortime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        result = prime * result + ((getNickname() == null) ? 0 : getNickname().hashCode());
        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
        result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode());
        result = prime * result + ((getIcon() == null) ? 0 : getIcon().hashCode());
        result = prime * result + ((getOtheruid() == null) ? 0 : getOtheruid().hashCode());
        result = prime * result + ((getToken() == null) ? 0 : getToken().hashCode());
        result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode());
        result = prime * result + ((getOpentype() == null) ? 0 : getOpentype().hashCode());
        result = prime * result + ((getSefdoctortime() == null) ? 0 : getSefdoctortime().hashCode());
        return result;
    }
}